home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / misc / vinced / include / vnc / io.h < prev    next >
C/C++ Source or Header  |  1999-04-19  |  3KB  |  65 lines

  1. #ifndef VNC_IO_H
  2. #define VNC_IO_H
  3. /*********************************************************
  4.  ** ViNCEd                                              **
  5.  ** a DOS - window handler                              **
  6.  **                                                     **
  7.  ** © 1991-98 THOR-Software inc.                        **
  8.  ** Version 3.60                                        **
  9.  **                                                     **
  10.  ** program version 3.60 22 Aug 1998    THOR            **
  11.  **                                                     **
  12.  ** ViNCEd I/O Functions and Definitions                **
  13.  **-----------------------------------------------------**
  14.  **                                                     **
  15.  ** all use at your own risk,etc.,etc.                  **
  16.  **                                                     **
  17.  ** Everything declared as "reserved" or                **
  18.  ** "not used" is NOT free for your use,                **
  19.  ** it will propably used in a later release.           **
  20.  ** All FREE entries are free for public                **
  21.  ** use and are, if not otherwise noticed,              **
  22.  ** initialized as ZERO                                 **
  23.  *********************************************************/
  24.  
  25. #ifndef EXEC_TYPES_H
  26. #include <exec/types.h>
  27. #endif
  28.  
  29. #ifndef DOS_DOS_H
  30. #include <dos/dos.h>
  31. #endif
  32.  
  33. /* this structure is a file handle as used by ViNCEd I/O functions */
  34.  
  35. typedef  struct {
  36.         BPTR fh_DOSHandle;              /* BPTR to DOS file structure */
  37.         void *fh_Buffer;                /* buffer itself */
  38.         UWORD fh_BufferLength;          /* its length */
  39.         UWORD fh_BufferContents;        /* # of valid bytes */
  40.         UWORD fh_BufferPos;             /* position of fileptr in buffer */
  41.         UWORD fh_DOSOffset;             /* offset of buffer in total file */
  42.         UBYTE fh_Mode;                  /* open mode, see below */
  43.         UBYTE fh_Flags;                 /* additional flags, internal */
  44.         char fh_RecordSep1;             /* record seperator, as LF or NUL */
  45.         char fh_RecordSep2;             /* a second one... */
  46.         ULONG fh_FilePointer;           /* absolute position in file */
  47. } FileHandle;
  48.  
  49. /* definition of flags: READ ONLY */
  50. #define FHFLG_CHANGED (1<<0)            /* buffer has been changed and must be written to disk */
  51. #define FHFLG_INTERACTIVE (1<<1)        /* belongs to interactive file (should check for non-filing system files as well...) */
  52.  
  53. /* definition of mode-flags: READ ONLY in structure, used for open */
  54. #define FHMOD_APPEND (1<<0)             /* append to end of file */
  55. #define FHMOD_READ (1<<2)               /* open for reading */
  56. #define FHMOD_WRITE (1<<3)              /* open for writing */
  57. #define FHMOD_RECORD (1<<6)             /* record-oriented IO */
  58. #define FHMOD_NONUL (1<<7)              /* don't write NULs on record IO */
  59.  
  60. /* this is implemented as a macro */
  61. #define FTell(file) ((file)->fh_FilePointer)
  62.  
  63. #endif
  64.  
  65.